<?php
namespace app\admin\validate;
class Admin extends \think\Validate{
    protected $rule = [
        'username|用户名'       =>  'require|unique:admin',
        'password|登录密码'     =>  'require|confirm:rePassword',
        'group_id|用户组'       =>  'require|gt:0'
    ];

    public function sceneEdit(){
        return $this->remove([
            'username'      =>  'unique',
            'password'      =>  'require'
        ]);
    }
}